import 'package:FineArt/components/rounded_button.dart';
import 'package:FineArt/constants.dart';
import 'package:FineArt/core/api/user_api.dart';
import 'package:FineArt/page/Login/login_screen.dart';
import 'package:FineArt/page/menu/login.dart';
import 'package:FineArt/utils/log_util.dart';
import 'package:FineArt/utils/size_config.dart';
import 'package:FineArt/utils/sputils.dart';
import 'package:flutter/material.dart';

class ChooseRole extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _MChooseRole();
  }
}

class _MChooseRole extends State<ChooseRole> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body:  Container(
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        margin: EdgeInsets.only(top:getPortraitSHeight(122)),
        color: Colors.white,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Container(
              padding: EdgeInsets.symmetric(vertical: 0, horizontal: 0),
              child: Image.asset(
                "assets/images/choose_role_icon.png",
                width: getPortraitSWidth(137),
                height: getPortraitSHeight(137),
              ),
            ),
            SizedBox(height: getPortraitSHeight(45),),
            RoundedButton(
              text: "我是老师",
              color: red_main,
              width: getPortraitSWidth(250),
              press: () {
                Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) {
                  return LoginScreen("teacher");
                }));
              },
            ),
            SizedBox(height: getPortraitSHeight(27.5),),
            RoundedButton(
              text: "我是学生",
              width: getPortraitSWidth(250),
              decoration: BoxDecoration(
                  border: Border.all(color: red_main, width: 1),
                  borderRadius: BorderRadius.circular(25)),
              textColor: red_main,
              color: Colors.white,
              press: () {
                LogUtil.d("student>>>>>>>");
                Navigator.of(context)
                    .push(MaterialPageRoute(builder: (context) {
                  return LoginScreen("student");
                }));
              },
            ),
          ],
        ),
      ),
    );
  }
}
